package com.corpgovernment.organization.entity.db;

import com.corpgovernment.common.annotation.OperateLogFieldDesc;
import com.corpgovernment.common.entity.db.BaseEntity;
import com.corpgovernment.common.enums.CommonEnum;
import com.corpgovernment.common.handler.Sm4TypeHandler;
import com.corpgovernment.organization.enumm.OrgTypeEnum;
import com.corpgovernment.organization.enumm.ValidEnum;
import lombok.Data;
import tk.mybatis.mapper.annotation.ColumnType;

import javax.persistence.*;


/**
 * 组织结构表
 **/
@Data
@Table(name = "mb_org_info")
@SuppressWarnings("serial")
public class MbOrgInfo extends BaseEntity {


    /**
     * 主键
     **/
    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    @OperateLogFieldDesc(value = "主键")
    private Long id;

    /**
     * 组织名
     **/
    @Column(name = "name")
    @OperateLogFieldDesc(value = "组织名")
    @ColumnType(typeHandler = Sm4TypeHandler.class)
    private String name;

    /**
     * 组织id(类似公司Id)
     **/
    @Column(name = "org_id")
    @OperateLogFieldDesc(value = "组织id")
    private String orgId;

    /**
     * 组织类型  G:集团 C:公司  D:部门
     **/
    @Column(name = "org_type")
    @OperateLogFieldDesc(value = "组织类型", type = OrgTypeEnum.class)
    private String orgType;

    /**
     * 上级id
     **/
    @Column(name = "parent_id")
    @OperateLogFieldDesc(value = "上级id")
    private String parentId;

    /**
     * 组织状态  T:使用中  F:已停用
     **/
    @Column(name = "valid")
    @OperateLogFieldDesc(value = "组织状态", type = ValidEnum.class)
    private String valid;

    /**
     * 层级 从1开始
     **/
    @Column(name = "level")
    @OperateLogFieldDesc(value = "层级")
    private Integer level;

    /**
     * 排序号 用于同级部门排序，1排在最上方
     */
    @Column(name = "order_num")
    @OperateLogFieldDesc(value = "排序号")
    private Integer orderNum;

    /**
     * 后台组织负责人
     */
    @Column(name = "admin_uid")
    @OperateLogFieldDesc(value = "后台组织负责人")
    private String adminUid;

    /**
     * 财务系统组织id
     */
    @Column(name = "bind_id")
    private String bindId;

    /**
     * 财务系统组织名称
     */
    @Column(name = "bind_name")
    private String bindName;

    /**
     * 联系人姓名
     */
	@ColumnType(typeHandler = Sm4TypeHandler.class)
    @Column(name = "contact_name")
    private String contactName;
    /**
     * 联系人手机号
     */
	@ColumnType(typeHandler = Sm4TypeHandler.class)
    @Column(name = "contact_phone")
    private String contactPhone;
    /**
     * 联系人手机号区域码
     */
    @Column(name = "contact_area_code")
    private String contactAreaCode;
    /**
     * 联系人邮箱
     */
    @Column(name = "contact_email")
    private String contactEmail;

    /**
     * 是否是后台组织
     */
    @Column(name = "is_background")
    @OperateLogFieldDesc(value = "是否是后台组织", type = CommonEnum.class)
    private Boolean isBackground;

    /**
     * 删除时间，1970-01-01 08:00:00.000代表未删除
     **/
    @Column(name = "delete_time")
    private java.util.Date deleteTime;

    /**
     * 创建时间
     **/
    @Column(name = "datachange_createtime")
    private java.util.Date datachangeCreatetime;

    /**
     * 最后更新时间
     **/
    @Column(name = "datachange_lasttime")
    private java.util.Date datachangeLasttime;

    /**
     * 是否开启统一支付
     */
    @Column(name = "open_unite_payment")
    private Boolean openUnitePayment;

    /**
     * 酒店支付方式 0未开启 1开启
     */
    @Column(name = "hotel_ppay")
    private Boolean hotelPpay;

    /**
     * 酒店统一支付 0未开启 1开启
     */
    @Column(name = "hotel_accnt")
    private Boolean hotelAccnt;

    @Column(name = "business_code")
    private String businessCode;

    @Column(name = "parent_business_code")
    private String parentBusinessCode;
}
